import { defineStore } from 'pinia'
import { ref } from 'vue'

// 按需导出
export const dataSet = defineStore('loadingShade', () => {

    // 控制loading显示与隐藏的变量
    const loadingShade = true

    // 车速
    const rotateSpeed = ref(0)

    // 轮毂空数组
    const carhub = ref([])
    // 轮毂子网格名称
    const wheelNames = [
        'gallardo_wheel_02a_19x11_gallardo_wheel_01a_0',
        'gallardo_wheel_02a_19x11001_gallardo_wheel_01a_0',
        'gallardo_wheel_02a_19x11003_gallardo_wheel_01a_0',
        'gallardo_wheel_02a_19x11002_gallardo_wheel_01a_0'
    ]

    // 轮胎空数组
    const cartyre = ref([])
    // 轮胎子网格名称
    const tireNames = [
        '3_Wheel_Scene_-_Root001_0',
        '3_Wheel_amdb11_brake001_0',
        '3_Wheel002_amdb11_caliper001_0',
        '3_Wheel001_Scene_-_Root001_0',
        '3_Wheel003_amdb11_caliper001_0',
        '3_Wheel001_amdb11_brake001_0',
        '3_Wheel002_Scene_-_Root001_0',
        '3_Wheel001_amdb11_caliper001_0',
        '3_Wheel003_amdb11_brake001_0',
        '3_Wheel003_Scene_-_Root001_0',
        '3_Wheel002_amdb11_brake001_0',
        '3_Wheel_amdb11_caliper001_0'
    ]

    // 车身颜色
    const carbodyColor = ref()
    // 备份子网格颜色
    const originalColors = {}

    // 是否开启改色
    const changeColor = true

    // 左车门
    let leftdoors = ref([])
    const leftdoorName = [
        'gallardo_door_L_gallardo_paint_0', 'gallardo_doorglass_L_tinted_gallardo_glass_tinted_0', 'gallardo_mirror_L_cf_gallardo_cf_0',
        'gallardo_mirror_L_cf_mirror_0',
        'gallardo_doorpanel_L_gallardo_leather_quilted_0',
        'gallardo_doorpanel_L_gallardo_leather_0',
        'gallardo_doorpanel_L_gallardo_cf_0',
        'gallardo_door_L_gallardo_misc_0',
        'gallardo_doorpanel_L_gallardo_mesh_0'
    ]

    // 右车门
    let rightdoors = ref([])
    const rightdoorName = [
        'gallardo_door_R_gallardo_paint_0', 'gallardo_doorglass_R_tinted_gallardo_glass_tinted_0', 'gallardo_mirror_R_cf_gallardo_cf_0',
        'gallardo_mirror_R_cf_mirror_0',
        'gallardo_doorpanel_R_gallardo_leather_quilted_0',
        'gallardo_doorpanel_R_gallardo_leather_0',
        'gallardo_doorpanel_R_gallardo_cf_0',
        'gallardo_door_R_gallardo_misc_0',
        'gallardo_doorpanel_R_gallardo_mesh_0'
    ]

    // 前车灯
    let headlights = ref([])
    const headlightNmae = [
        'gallardo_headlight_R_gallardo_lights_0',
        'gallardo_headlight_L_gallardo_lights_0',
        'gallardo_headlight_R_gallardo_headlight_0',
        'gallardo_headlight_L_gallardo_signal_L_0',
        'gallardo_headlight_R_gallardo_runninglight_0',
        'gallardo_headlight_R_gallardo_signal_R_0'
    ]

    // 后车灯
    let taillights = ref([])
    const taillightName = [
        'gallardo_taillightglass_L_gallardo_glass_0',
        'gallardo_taillightglass_R_gallardo_glass_0'
    ]

    // 不需要虚化的部件
    let gallardos = ref([])
    const gallardoName = [
        'gallardo_engine_gallardo_turbo_matblack_0',
        'gallardo_exhaust_header_gallardo_turbo_matblack_0',
        'gallardo_exhaust_quad_gallardo_turbo_matblack_0',
        'gallardo_engine_biturbo_gallardo_metal_0',
        'gallardo_exhaust_header_turbo_gallardo_turbo_matblack_0',
        'gallardo_stockintake_gallardo_turbo_matblack_0',
        'gallardo_engine_gallardo_turbo_black_0',
        'gallardo_wheel_02a_19x11_gallardo_wheel_01a_0',
        'gallardo_wheel_02a_19x11001_gallardo_wheel_01a_0',
        'gallardo_wheel_02a_19x11003_gallardo_wheel_01a_0',
        'gallardo_wheel_02a_19x11002_gallardo_wheel_01a_0',
        '3_Wheel_Scene_-_Root001_0',
        '3_Wheel_amdb11_brake001_0',
        '3_Wheel002_amdb11_caliper001_0',
        '3_Wheel001_Scene_-_Root001_0',
        '3_Wheel003_amdb11_caliper001_0',
        '3_Wheel001_amdb11_brake001_0',
        '3_Wheel002_Scene_-_Root001_0',
        '3_Wheel001_amdb11_caliper001_0',
        '3_Wheel003_amdb11_brake001_0',
        '3_Wheel003_Scene_-_Root001_0',
        '3_Wheel002_amdb11_brake001_0',
        '3_Wheel_amdb11_caliper001_0',
        'gallardo_engine_gallardo_nodam_0',
        'gallardo_engine_gallardo_turbo_gray_0',
        'gallardo_exhaust_quad_gallardo_misc_0',
        'gallardo_engine_biturbo_airfilter_gallardo_turbo_gray_0',
        'gallardo_dash_gallardo_cf_0',
        'gallardo_dash_gallardo_leather_0',
        'gallardo_comodo_gallardo_cockpit_0',
        'gallardo_body_gallardo_leather_0',
        'gallardo_seat_FR_sl_gallardo_alcantara_0',
        'gallardo_seat_FL_sl_gallardo_alcantara_0',
        'gallardo_steer_gallardo_steeringwheel_0',
        'gallardo_body_gallardo_carpet_0',
        'gallardo_steeringwheel_support_gallardo_cockpit_0',
        'gallardo_steeringwheel_support_gallardo_leather_0'
    ]

    // 车衣
    const coatPictures = ref([])
    const coatPictureName = [
        'gallardo_hood_b_gallardo_paint_0',
        'gallardo_bumper_F_LW_gallardo_paint_0',
        'gallardo_fenderflare_FL_gallardo_paint_0',
        'gallardo_fenderflare_FR_gallardo_paint_0',
        'gallardo_door_R_gallardo_paint_0',
        'gallardo_door_L_gallardo_paint_0',
        'gallardo_body_gallardo_paint_0',
        'gallardo_bumper_R_LW_gallardo_paint_0',
        'gallardo_fender_R_gallardo_paint_0',
        'gallardo_fender_L_gallardo_paint_0',
        'gallardo_fenderflare_RL_gallardo_paint_0',
        'gallardo_fenderflare_RR_gallardo_paint_0',
        'gallardo_spoiler_LW2_gallardo_cf_0',
        'gallardo_spoiler_LW2_gallardo_paint_0',
        'gallardo_bumper_F_LW_gallardo_cf_0',
        'gallardo_bumper_F_LW_valance_gallardo_cf_0'
    ]


    // 虚化时开启描边
    const carContour = false

    // 将要使用的数据 （return） 出去
    return {
        loadingShade,
        rotateSpeed,
        carbodyColor,
        changeColor,
        carhub,
        wheelNames,
        cartyre,
        tireNames,
        originalColors,
        leftdoors,
        leftdoorName,
        rightdoors,
        rightdoorName,
        headlights,
        headlightNmae,
        taillights,
        taillightName,
        gallardos,
        gallardoName,
        coatPictures,
        coatPictureName,
        carContour
    }
})